package com.wootide.cms.service.facility.room.roominfo.pojo;

import java.sql.Timestamp;

import com.wootide.cms.service.reservation.bookinfo.pojo.BookOrderInfo;
/**
 * 房间时段表
 * 〈一句话功能简述〉
 * 〈功能详细描述〉
 * @author ozm
 * @version 2013-3-8
 * @see RoomPeriod
 * @since 2013-3-8下午4:36:07
 */
public class RoomPeriod implements java.io.Serializable,Comparable<RoomPeriod>
{
    /**
     * 意义，目的和功能，以及被用到的地方<br>
     */
    private static final long serialVersionUID = 1L;

    //房间时段ID
    private Integer innerIndex;
    
    //房间信息
    private RoomInfo roomInfo;
    
    //预订订单
    private BookOrderInfo bookOrderInfo;
    //开始时间
    private Timestamp startTime;
    
    //结束时间
    private Timestamp endTime;
    
    //房间状态
    private Integer status;

    /**
     * toString
    /* 实现 Comparable 接口中的 compareTo 方法，
    * 通常大于时返回一个正数，小于时返回一个负数，
    * 等于时返回零，具体情况可以自行决定。
    *********************************************************
    * 这里我根据 索引的大小进行了比较。由于 TreeSet
    * 会根据 compareTo 的结果来排序，因此输出结果
    * 应该是按照 索引从小到大排序的。
    * 如果要根据姓名进行排序，只需对这个方法进行相应的修改。*/

   public int compareTo(RoomPeriod arg) 
   {
           if (innerIndex > arg.innerIndex)
           {
               return 1;
           }
           else if (innerIndex == arg.innerIndex)
           {
               return 0;
           }
           else
           {
               return -1;
           }
                   
   }


   

    @Override
    public String toString()
    {
        return "RoomPeriod [innerIndex=" + innerIndex + ", roomInfo="
                + roomInfo + ", bookOrderInfo=" + bookOrderInfo
                + ", startTime=" + startTime + ", endTime=" + endTime
                + ", status=" + status + "]";
    }

    public BookOrderInfo getBookOrderInfo()
    {
        return bookOrderInfo;
    }

    public void setBookOrderInfo(BookOrderInfo bookOrderInfo)
    {
        this.bookOrderInfo = bookOrderInfo;
    }

    public Integer getInnerIndex()
    {
        return innerIndex;
    }

    public void setInnerIndex(Integer innerIndex)
    {
        this.innerIndex = innerIndex;
    }

    public RoomInfo getRoomInfo()
    {
        return roomInfo;
    }

    public void setRoomInfo(RoomInfo roomInfo)
    {
        this.roomInfo = roomInfo;
    }

    public Timestamp getStartTime()
    {
        return startTime;
    }

    public void setStartTime(Timestamp startTime)
    {
        this.startTime = startTime;
    }

    public Timestamp getEndTime()
    {
        return endTime;
    }

    public void setEndTime(Timestamp endTime)
    {
        this.endTime = endTime;
    }

    public Integer getStatus()
    {
        return status;
    }

    public void setStatus(Integer status)
    {
        this.status = status;
    }
    
   
    
}